home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / xref_v1.1.lha / XRef / Tools / lib / getmaxdigitwidth.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-17  |  534 b   |  38 lines

  1. /*
  2. ** $PROJECT: xrefsupport.lib
  3. **
  4. ** $VER: getmaxdigitwidth.c 1.1 (16.09.94)
  5. **
  6. ** by
  7. **
  8. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  9. **
  10. ** (C) Copyright 1994
  11. ** All Rights Reserved !
  12. **
  13. ** $HISTORY:
  14. **
  15. ** 16.09.94 : 001.001 :  initial
  16. */
  17.  
  18. #include "/source/def.h"
  19.  
  20. UWORD getmaxdigitwidth(struct RastPort *rp)
  21. {
  22.    UWORD max = 0;
  23.    UWORD x;
  24.    UWORD i;
  25.    UBYTE chr;
  26.  
  27.    for(i = 0 ; i < 9 ; i++)
  28.    {
  29.       chr = '0' + i;
  30.  
  31.       if((x = TextLength(rp,&chr,1)) > max)
  32.          max = x;
  33.    }
  34.  
  35.    return(max);
  36. }
  37.  
  38.